import { ref } from 'vue'

const useBoolean = (state = false) => {
    
    const bool = ref(Boolean(state))

    const trigger = () => (bool.value = !bool.value)

    const setTrue = () => (bool.value = true)

    const setFalse = () => (bool.value = false)

    return { bool,  trigger, setTrue, setFalse }
}

export default useBoolean